fix(security): Migration auf @huggingface/transformers v4 + ner-worker-Build-Fix#4
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Plan was fully implemented on 2026-03-17 (GitHub release v0.7.0, mingly-website commit 02e6d22, preprocessor fixes shipped) but the checkboxes were never ticked. Verified against live site, app and release on 2026-07-02; marked done and committed as historical record. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces @xenova/transformers 2.17.2 with @huggingface/transformers 4.2.0 (the maintained successor). Eliminates the entire protobufjs critical advisory chain (11 advisories incl. GHSA-xq3m-2v4x-88gg arbitrary code execution) via @xenova -> onnxruntime-web -> onnx-proto -> protobufjs: npm audit --omit=dev is now clean (0 vulnerabilities). API changes: package rename in 4 dynamic imports; quantized:false -> dtype:'fp32' (option removed in v3+). env.cacheDir/allowRemoteModels, progress_callback, cache layout and token-classification output are unchanged - the existing piiranha-v1 model cache is reused without re-download. Also fixes a latent build gap: dist/main/ner-worker.js was never built (no esbuild entry), so NERDetector silently fell back to [] in packaged builds - the 3-layer NER path was dead in production. New build:ner-worker script is chained into build. Verified: typecheck + full test suite green, build produces the worker bundle, RUN_3LAYER=1 red-team run loads piiranha via the new library from the existing cache (776ms) with 42 failures vs 48 in the 2026-03-17 baseline - all 7 documented NER-fixed tests still pass, no regressions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ersetzt den automatisch geschlossenen #3 (Base-Branch von #2 wurde nach Merge gelöscht). Inhalt unverändert — Details und Verifikation siehe #3.
Kurzfassung
npm audit --omit=dev= 0 Vulnerabilitiesbuild:ner-workerin Build-Chain) — 3-Layer-NER-Pfad war im Release-Build totdist:macprüfen (asar-Unpack)🤖 Generated with Claude Code